
$(function(){
	var reportType="html";
	var reportId = $("#" + tabId + " #reportGroup > ul > li.active > a").attr("href").substring(1) ;
	//日期控件赋初值  |  默认首页和分组表最近时间
	initeDatetimepicker(2,reportId) ;
	tabId=$("#tabContent > .tab-pane.active").attr("id");
	
	$("#navTabs").find("li").each(function(i){
		$(this).on("click", function () {
			scrollTo(0,0);
			tabId=$("#tabContent > .tab-pane.active").attr("id");
         });
	});
	
	// 报表组各报表id
	var reportgroup = [] ;
	$("#"+tabId+ " .tab-pane").each(function(){
		reportgroup.push($(this).attr("id")) ;
	})
	// 导出按钮绑定事件
	$("#"+tabId+ " #exportType a").each(function(){
		$(this).click(function() {
			// 导出报表组
			if(reportgroup.length > 1) {
				showReport(this.name,reportgroup.join(",")) ;
			} else {
				showReport(this.name,reportId) ;
			}
		});
	}); 
	
	//弹出层表头悬停
	$(window).scroll(onScroll);
	// 导出报表
	$("#"+tabId+ " #search_png").click(function(){
		showReport(reportType,reportId,true,"btn",true);
	})
	// 预览报表
	showReport(reportType,reportId,null,null,true);
	
	$("#" + tabId + " #reportGroup > ul > li").each(function(){
		$(this).on("click",function(){
			reportId = $(this).find("a").attr("href").substring(1) ;
			showReport(reportType,reportId,true,null,true) ;
 		});
	});
});



